<%--
  Created by IntelliJ IDEA.
  User: 16398
  Date: 2020/6/5
  Time: 15:25
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<html>
<head>
    <link rel="stylesheet" href="admin/css/bootstrap.min.css" type="text/css"/>
    <script type="text/javascript" src="admin/js/jquery.min.js" ></script>
    <script type="text/javascript" src="admin/js/bootstrap.js" ></script>
    <title>用户管理</title>
</head>
<body style="margin-top: 65px;">

<nav class="navbar navbar-default navbar-fixed-top navbar-inverse" role="navigation">
    <!--container-fluid表示自适应大小，container表示居中-->
    <div class="container">
        <!--定义顶部导航栏-->
        <div class="navbar-header">
            <!--button是当屏幕小于多少时出现的可以打开导航列表的按钮-->
            <button type="button" class="navbar-toggle collapsed"
                    data-toggle="collapse" data-target="#demo-navbar">
                <span class="sr-only">Toggle navigation</span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
            </button>
            <a class="navbar-brand" href="#">疫情助手后台管理</a>
        </div>

        <!--collapse用于导航栏折叠之后数据在button按钮里点击显示-->
        <div class="collapse navbar-collapse" id="demo-navbar">
            <!--nav navbar-nav表示显示在导航栏里-->
            <ul class="nav navbar-nav">
                <li class="dropdown-toggle"><a href="http://127.0.0.1:8080/YQZS/index">首页</a></li>
                <li class="dropdown">
                    <a href="#" class="dropdown-toggle" data-toggle="dropdown">功能<span class="caret"></span></a>
                    <ul class="dropdown-menu" role="menu">
                        <!--通过dropdown-header来标记一组动作-->
                        <li><a href="http://127.0.0.1:8080/YQZS/userinfo">查看用户</a></li>
                        <li role="presentation" class="divider"></li>
                        <li><a href="#">疫情数据</a></li>
                        <li role="presentation" class="divider"></li>
                        <li><a href="#">疫情分析</a></li>
                    </ul>
                </li>

                <li><a href="#" data-toggle="modal" data-target="#about">帮助</a></li>

            </ul>

            <ul class="nav navbar-nav navbar-right">
                <li class="dropdown">
                    <a href="#" class="dropdown-toggle" data-toggle="dropdown" data-hover="dropdown">
                        欢迎您,
                        <span id="usname"></span>
                        <b class="caret"></b>
                    </a>
                    <ul class="dropdown-menu">
                        <li><a href="#updateinfo" data-toggle="modal">个人资料</a></li>
                        <li role="presentation" class="divider"></li>
                        <li><a href="#updatepwd" data-toggle="modal">修改密码</a></li>
                        <li role="presentation" class="divider"></li>
                        <li><a href="http://127.0.0.1:8080/YQZS/login">退出</a></li>
                    </ul>
                </li>
            </ul>

        </div>

    </div>
</nav>

<div class="container-fluid">
    <div class="row">
        <div class="col-md-10">
            <h2>用户信息</h2>
            <hr class="divider">

            <div id="panel-group">

                <div class="panel panel-primary">
                    <div class="panel-heading">
                        <h3 class="panel-title">用户数据</h3>
                    </div>
                    <div class="panel-body">
                        <table class="table">
                            <thead>
                            <tr>
                                <th>序号</th>
                                <th>用户编号</th>
                                <th>用户类型</th>
                                <th>账号</th>
                                <th>密码</th>
                            </tr>
                            </thead>
                            <tbody>
                            <c:forEach items="${userLister}" var="user" varStatus="idxStatus">
                                <tr>
                                    <th>${idxStatus.index}</th>
                                    <th>${user.createUserId}</th>
                                    <c:if test="${user.userLevel =='0' }">
                                        <th>普通用户</th>
                                    </c:if>
                                    <c:if test="${user.userLevel =='1' }">
                                        <th>管理员用户</th>
                                    </c:if>
                                    <th>${user.userLoginName}</th>
                                    <th>${user.plaintPwd}</th>
                                </tr>
                            </c:forEach>

                            </tbody>
                        </table>
                    </div>
                </div>



            </div>


        </div>

    </div>

</div>




<script type="text/javascript">
    var userdt = JSON.parse(sessionStorage.getItem("user"));
    $("#usname").text(userdt.result.userLoginName);
</script>

</body>
</html>
